<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
echo "<h2>Созданные скидки</h2>";
$this->table->set_heading('id', 'Процент скидки', 'Необходимая сумма', 'Действия');
$tmpl = array('table_open' => '<table border="0" cellpadding="0" cellspacing="0" class="admin_table">');
$this->table->set_template($tmpl);

$class = 'discount';
if ($this->users_rights_model->check_rights($class, 'block', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'unblock', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'edit', true)) $canedit = 1;
if ($this->users_rights_model->check_rights($class, 'delete', true)) $candelete = 1;
if ($this->users_rights_model->check_rights($class, 'add', true)) $canadd = 1;


foreach ($pages as $page) {
	$this->table->add_row(
			$page['discount_id'],
			$page['discount_procent'],
			$page['discount_price'],
			showmeactions(
					$class,
					$page['discount_id'],
					$page['discount_status'],
					0, $candelete, 0,
					$from
				)
		);
}
echo $this->table->generate();
echo $paging;
echo $form;
echo "<div class='cc'></div>";
?>
